{% extends "indexed/base.html" %}

{% block title %}Search{% if q %} Results{% endif %}{% endblock %}


{% block content %}
<script type="text/javascript">
  var len="";

  function checklength()
  {
    if (len != p.value)
      {update_res();
      len = p.value;}
  }

  function update_res() 
  {
    new Ajax.Updater("res_div", '/indexed/refresh/?p='+p.value, {asynchronous:true});
  }
</script>

<h1>Search Files</h1>
  
<label for="q">Search: </label>
<input type="text" name="p" value="{{ q|escape }}" onMouseDown="checklength();" OnKeyDown="checklength();" OnKeyUp="checklength();">

<div id="res_div">
  {% include 'indexed/res.html' %} 
</div>
{% endblock %}
